using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class Game2Map : EntityTypeConfiguration<Game2>
    {
        public Game2Map()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("Game2");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.GameId).HasColumnName("GameId");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Score).HasColumnName("Score");
        }
    }
}
